clear; close all;

%% mat comp
% CAP
Tg = [7.1 44.7 227.4 501.0];
Tr = [8.4 76.9 635.6 2367.9];
Tf = [0.7 3.5 11.4 24.3];
Taf = [0.3 0.8 1.9 3.5];

SF1 = Tg./Tf;
SF2 = Tg./Taf;

figure(1);
plot(SF1, '--x' ,'color', 'blue', 'linewidth', 2, 'MarkerSize',10);
set(gca,'xtick',1:4,'xticklabel',500:500:2000);
xlabel('Matrix Size');
ylabel('Speedup');

hold on;

plot(SF2, ':o' ,'color', 'black', 'linewidth', 2, 'MarkerSize',10);
set(gca,'xtick',1:4,'xticklabel',500:500:2000);
xlabel('Matrix Size');
ylabel('Speedup');

legend({'FGLR', 'AccFGLR'}, 'Location','northwest', 'FontSize', 12);
axis([0.9, 4.1, 1, 160]);

% LOG
Tg = [40.9 467.8 2898.5];
Tr = [41.4 573.7 3496.2];
Tf = [1.6 10.5 32.8];
Taf = [0.8 3.2 5.5];

SF1 = Tg./Tf;
SF2 = Tg./Taf;

figure(2);
plot(SF1, '--x' ,'color', 'blue', 'linewidth', 2, 'MarkerSize',10);
set(gca,'xtick',1:3,'xticklabel',500:500:1500);
xlabel('Matrix Size');
ylabel('Speedup');

hold on;

plot(SF2, ':o' ,'color', 'black', 'linewidth', 2, 'MarkerSize',10);
set(gca,'xtick',1:4,'xticklabel',500:500:2000);
xlabel('Matrix Size');
ylabel('Speedup');

legend({'FGLR', 'AccFGLR'}, 'Location','northwest', 'FontSize', 12);
axis([0.9, 3.1, 1, 550]);

% TNN
Tg = [6.9 44.9 223.1 658.6];
Tr = [8.2 76.4 611.6 2209.2];
Tf = [0.7 3.4 11.1 24.5];
Taf = [0.3 0.9 1.8 3.3];

SF1 = Tg./Tf;
SF2 = Tg./Taf;

figure(3);
plot(SF1, '--x' ,'color', 'blue', 'linewidth', 2, 'MarkerSize',10);
set(gca,'xtick',1:4,'xticklabel',500:500:2000);
xlabel('Matrix Size');
ylabel('Speedup');

hold on;

plot(SF2, ':o' ,'color', 'black', 'linewidth', 2, 'MarkerSize',10);
set(gca,'xtick',1:4,'xticklabel',500:500:2000);
xlabel('Matrix Size');
ylabel('Speedup');

legend({'FGLR', 'AccFGLR'}, 'Location','northwest', 'FontSize', 12);
axis([0.9, 4.1, 1, 210]);

%% rpca
% CAP
% Tg = [0.9 6.7 18.7 60.4];
% Tf = [0.2 1.4 2.7 6.5];
% 
% SF1 = Tg./Tf;
% 
% figure(1);
% plot(SF1, '--x' ,'color', 'blue', 'linewidth', 2, 'MarkerSize',10);
% set(gca,'xtick',1:4,'xticklabel',500:500:2000);
% xlabel('Matrix Size');
% ylabel('Speedup');
% axis([0.9, 4.1, 4, 10]);
% 
% LSP
% Tg = [2.7 18.5 111.2 250.2];
% Tf = [0.4 1.8 3.9 7.1];
% 
% SF1 = Tg./Tf;
% 
% figure(2);
% plot(SF1, '--x' ,'color', 'blue', 'linewidth', 2, 'MarkerSize',10);
% set(gca,'xtick',1:4,'xticklabel',500:500:2000);
% xlabel('Matrix Size');
% ylabel('Speedup');
% axis([0.9, 4.1, 4, 40]);
% 
% TNN
% Tg = [0.8 6 23.1 51.4];
% Tf = [0.2 1.2 2.9 5.8];
% 
% SF1 = Tg./Tf;
% 
% figure(3);
% plot(SF1, '--x' ,'color', 'blue', 'linewidth', 2, 'MarkerSize',10);
% set(gca,'xtick',1:4,'xticklabel',500:500:2000);
% xlabel('Matrix Size');
% ylabel('Speedup');
% axis([0.9, 4.1, 3, 10]);
